#include "udpServer.hpp"
#include <iostream>
#include <memory>
using namespace std;
using namespace Server;

static void Usage(string proc)
{
    cout << "\nUsage:\n\t" << proc << " lock_ip lock_port\n\n";
}
// ./UdpServer ip prot
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[2]);
    string ip = argv[1];
    std::unique_ptr<udpserver> usvr(new udpserver(port, ip));
    usvr->initServer();
    usvr->start();
    return 0;
}